"""Django_base_t URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/2.2/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path,include,register_converter
from converters import MobileConverter
from users import views

# 自定义的转化器  自定义转换器,'别名'
register_converter(MobileConverter,'mobile')

urlpatterns = [
    # admin 路由 django自带的
    path('admin/', admin.site.urls),

    # 定义登录的路由
    path('login1/', views.index),
    # 注册子路由
    path('',include('users.urls')),

    # path('',include('response.urls')),
    # 重定向反向解析
    path('',include(('response.urls','response'),namespace='response')),
    path('',include(('booktest.urls','booktest'),namespace='booktest')),
]


# MVT的流程
# 1. 前端发送请求
# 2. 根据路由发送的
# 3. 后端接受请求 --判断 路由 --找 V--视图
# 4. V--视图根据请求内容 判断需要什么数据 -- Model
# 5. Model-- data--V
# 6. V --
# 7. V --> 前端
